<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Slider extends Model
{
    use HasFactory;
    // 追加属性
    protected $appends = ['img_url'];

    protected $fillable = ['title', 'url', 'img', 'status', 'seq'];

    /**
     * Desc: 属性修改器
     * @return mixed|string
     * Date: 2024/11/1 10:06
     */
    public function getImgUrlAttribute(){
        return qiniu_url($this->img);
    }
}
